<?php

class CommonController extends Zend_Controller_Action
{
    public function init()
    {
        /* Initialize action controller here */
    }

    /**
     * 获取菜单项头部
     */
    public function menuheadAction()
    {

    }

    /**
     * 获取菜单项尾部
     */
    public function menufootAction()
    {

    }

    /**
     * 获取省市区列表
     */
    public function regionSelectAction()
    {
        $region_biz = new \Biz\Region();
        // 中国的ID是1
        // 省
        $province_list = $region_biz->getRegionListByParentId(1);
        // 市
        if (property_exists($this->view, 'province_id')) {
            $province_id = $this->view->province_id;
        } else {
            $province_info = reset($province_list);
            $province_id = $province_info['id'];
        }
        $city_list = $region_biz->getRegionListByParentId($province_id);
        // 区域
        if (property_exists($this->view, 'city_id')) {
            $city_id = $this->view->city_id;
        } else {
            $city_info = reset($city_list);
            $city_id = $city_info['id'];
        }
        $area_list = $region_biz->getRegionListByParentId($city_id);
        $this->view->province_list = $province_list;
        $this->view->city_list = $city_list;
        $this->view->area_list = $area_list;
    }

    /**
     * 客户状态列表
     */
    public function customerStatusSelectAction()
    {
    }
}